SliceColorCategoriesProxyModel
Base classes
| Name | Children | Inherits |
|---|---|---|
| SliceIdentityProxyModel prettyqt.itemmodels.proxies.sliceidentityproxymodel Base model for slice proxy models. |
|
â‹” Inheritance diagram
graph TD
2809350507["itemmodels.SliceColorCategoriesProxyModel"]
4214724289["itemmodels.SliceIdentityProxyModel"]
527136029["core.IdentityProxyModel"]
2431222121["core.AbstractProxyModelMixin"]
3882849576["core.AbstractItemModelMixin"]
3227531497["core.ObjectMixin"]
2751680898["builtins.object"]
3668892142["QtCore.QIdentityProxyModel"]
3989152870["QtCore.QAbstractProxyModel"]
1898060022["QtCore.QAbstractItemModel"]
3984060476["QtCore.QObject"]
37984305["Shiboken.Object"]
4214724289 --> 2809350507
527136029 --> 4214724289
2431222121 --> 527136029
3882849576 --> 2431222121
3227531497 --> 3882849576
2751680898 --> 3227531497
3668892142 --> 527136029
3989152870 --> 3668892142
1898060022 --> 3989152870
3984060476 --> 1898060022
37984305 --> 3984060476
2751680898 --> 37984305
🛈 DocStrings
Bases: SliceIdentityProxyModel
Proxy model to apply coloring to categories.
Example
model = MyModel()
table = widgets.TableView()
table.set_model(model)
table[:, :3].proxify.color_categories()
table.show()
# or
indexer = (slice(None), slice(None, 3))
proxy = itemmodels.SliceColorCategoriesProxyModel(indexer=indexer)
proxy.set_source_model(model)
table.set_model(proxy)
table.show()
Source code in prettyqt/itemmodels/proxies/slicecolorcategoriesproxymodel.py
cast_to_str = core.Property(bool, is_casted_to_str, set_cast_to_str, doc='Cast values to string in order to color / group them')
class-attribute
instance-attribute
Cast all values to a string for deciding whether cells are in same category.
color_none = core.Property(bool, is_none_colored, set_none_colored, doc='Whether None-values should also get colored')
class-attribute
instance-attribute
Color ItemData with value None.